import { createWebHashHistory, createRouter } from 'vue-router'
/* Layout */
import Layout from '@/layout'
import { KeepAlive } from 'vue'

// import useUserStore from '@/store/modules/user'
// const userStore11 = useUserStore()


/**
 * Note: 一级菜单
companyRole - 'zx','putBox','cars','sellBox' //货代 集装箱公司 集卡 卖箱

 */


/**
 * Note: 二级菜单
 * 
 * 二级菜单companyRole  + 
 * 
 * 货代-- 
// 'rent', // 租赁
// 'returnBox', //回调箱
// 'buyBox' //购箱
// 'carServer', //集卡车服务
// 'box',  //集装箱
// 'financial', //财务
集装箱公司
// 'rent', // 租赁
// 'box',  //集装箱
// 'returnBox', //回调箱
// 'yard', // 堆场
// 'financial', //财务
集卡
// 'carServer', //集卡车服务
// 'transport' //运输
// 'financial', //财务
// 'dataAnaly' // 数据分析
卖箱
// 'sellBox', //售箱
// 'box',  //集装箱
// 'financial', //财务
// 'dataAnaly' // 数据分析


 */


/**
 * Note: 路由配置项
 * 
 * 
// path: '',
// component: 'Layout',
// meta: { title: '租箱', icon: '', tags: ['rent'] },
// redirect: '', //是否可以点击
// type:2,//1菜单 2按钮
// companyRole:'zx-rent',//集装箱公司货代等'zx','putBox','cars','sellBox'
// hidden:true,//是否显示菜单
// roles:[''],// 访问路由的角色权限
// permissions: [],  // 访问路由的菜单权限
// name: '', //key （同级name须保持唯一性）
// sort:'',//排序/


 */
// 自定义
export const constantRoutesTest = [
  
{
  path: '',
  component: 'Layout',
  meta: { title: '货代', icon: '', tags: [] },
  type:2,
  companyRole:'zx',
  hidden:true,
  roles:[],
  permissions: [],  
  name: 'zx', 
  sort:'',
  children: [
    {
      path: '/index',
      component: 'Layout',
      meta: { title: '租箱', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'rent',
      hidden:true,
      roles:[],
      permissions: [], 
      name: 'rent',
      sort:'',
    },
    {
      path: '/index',
      component: 'Layout',
      meta: { title: '回调箱', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'returnBox',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'returnBox', 
      sort:'',
    },
    {
      path: '/index',
      component: 'Layout',
      meta: { title: '购箱', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'buyBox',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'buyBox', 
      sort:'',
    },{
      path: '/carServer/searchCar',
      component: 'Layout',
      meta: { title: '集卡车队', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'carServer',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'carServer', 
      sort:'',
    },{
      path: '/financialManageHD/agentInvoicesManage',
      component: 'Layout',
      meta: { title: '财务', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'financial',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'financial', 
      sort:'',
    },
  ]
},
{
  path: '',
  component: 'Layout',
  meta: { title: '集装箱公司', icon: '', tags: [] },
  type:2,
  companyRole:'putBox',
  hidden:true,
  roles:[],
  permissions: [],  
  name: 'putBox', 
  sort:'',
  children: [
    {
      path: '/index',
      component: 'Layout',
      meta: { title: '租箱', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'rent',
      hidden:true,
      roles:[],
      permissions: [], 
      name: 'rent',
      sort:'',
    },
    {
      path: '/boxManage/myBox',
      component: 'Layout',
      meta: { title: '集装箱', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'box',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'box', 
      sort:'',
    },
    {
      path: '/index',
      component: 'Layout',
      meta: { title: '回调', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'returnBox',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'returnBox', 
      sort:'',
    },{
      path: '/yardServer/searchYard',
      component: 'Layout',
      meta: { title: '精选堆场', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'yard',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'yardServer', 
      sort:'',
    },{
      path: '/financialManage/rentInvoicesManage',
      component: 'Layout',
      meta: { title: '财务', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'financial',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'financial', 
      sort:'',
    },
  ]
},
{
  path: '',
  component: 'Layout',
  meta: { title: '集卡', icon: '', tags: [] },
  type:2,
  companyRole:'cars',
  hidden:true,
  roles:[],
  permissions: [],  
  name: 'cars', 
  sort:'',
  children: [
    {
      path: '',
      component: 'Layout',
      meta: { title: '集卡车队', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'car',
      hidden:true,
      roles:[],
      permissions: [], 
      name: 'car',
      sort:'',
    },
    {
      path: '',
      component: 'Layout',
      meta: { title: '运输', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'transport',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'transport', 
      sort:'',
    },
   {
      path: '/enterpriseManage/accountCenter',
      component: 'Layout',
      meta: { title: '经营分析', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'businessAnalysis',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'businessAnalysis', 
      sort:'',
    }
  ]
},
{
  path: '',
  component: 'Layout',
  meta: { title: '卖箱', icon: '', tags: [] },
  type:2,
  companyRole:'sellBox',
  hidden:true,
  roles:[],
  permissions: [],  
  name: 'sellBox', 
  sort:'',
  children: [
    {
      path: '/index',
      component: 'Layout',
      meta: { title: '出售箱', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'sellBox',
      hidden:true,
      roles:[],
      permissions: [], 
      name: 'sellBox',
      sort:'',
    },
    {
      path: '/financialManageBoxSell/boxSellInvoicesManage',
      component: 'Layout',
      meta: { title: '财务管理', icon: '', tags: [] },
      redirect: '', 
      type:2,
      companyRole:'financial',
      hidden:true,
      roles:[],
      permissions: [],
      name: 'financial', 
      sort:'',
    }
  ]
},
]


// 公共路由
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login'),
    hidden: true
  },
  {
    path: '/adminiLogin',
    component: () => import('@/views/adminiLogin'),
    hidden: true
  },
  {
    path: '/register',
    component: () => import('@/views/register'),
    hidden: true
  },
  {
    path: '/home',
    component: () => import('@/views/home'),
    hidden: true
  },
  // {
  //   path: "/:pathMatch(.*)*",
  //   component: () => import('@/views/error/404'),
  //   hidden: true
  // },
  {
    path: '/401',
    component: () => import('@/views/error/401'),
    hidden: true
  },
  {
    path: '/boxRules',
    component: () => import('@/views/success/EQianBao'),
  },
  {
    path: '',
    component: Layout,
    redirect: '/index',
    hidden: true,
    children: [
      {
        path: '/index',
        component: () => import('@/views/index'),
        name: 'Index',
        meta: { title: '工作台', icon: 'dashboard', affix: true }
      }
    ]
  },
  {
    path: '/EQianBao_success',
    component: () => import('@/views/success/EQianBao'),
    hidden: true
  },
]
//货代公用

export const constantRoutesHd = [
      {
    path: '/boxRentAgent',
    component: Layout,
    children: [
      {
        path: 'rentBox',
        component: () => import('@/views/boxRentAgent/rentBox/index'),
        name: 'rentBoxNewOne1',
        meta: { title: '租箱市场'}
      },
     
    ]
  },
  {
    path: '/boxRentAgent',
    component: Layout,
    children: [
       {
        path: 'myRentBox',
        component: () => import('@/views/myRentBox/index'),
        name: 'myRentBoxNewOne1',
        meta: { title: '租箱记录'}
      },
    ]
  },
  {
    path: '/agentNewRent',
    component: Layout,
    children: [
      {
        path: 'agentNewRent',
        component: () => import('@/views/agentNewRent/index'),
        name: 'agentNewRentOne1',
        meta: { title: '广告发布'}
      },
    ]
  },
   {
    path: '/orderManageHD',
    component: Layout,
    children: [
      {
        path: 'rentOrder',
        component: () => import('@/views/orderManageHD/rentOrder/agentRentOrder'),
        name: 'agentRentOrderNewOne1',
        meta: { title: '订单管理'}
      },
    ]
  },
   {
    path: '/placingOrder',
    component: Layout,
    children: [
      {
        path: 'exportOrder/details',
        component: () => import('@/views/placingOrder/exportOrder/details'),
        name: 'detailsNew1',
        meta: { title: '订单详情'},
        hidden: true
      },
    ]
  },
   {
    path: '/placingOrder',
    component: Layout,
    children: [
      {
        path: '/exportOrder/detaisInfo',
        component: () => import('@/views/placingOrder/exportOrder/detaisInfo'),
        name: 'detaisInfo11',
        meta: { title: '租箱详情'},
        hidden: true
      },
    ]
  },
    {
    path: '/placingOrder',
    component: Layout,
    children: [
      {
        path: 'exportOrder',
        component: () => import('@/views/placingOrder/exportOrder/index'),
        name: 'exportOrderNewOne1',
        meta: { title: '下单详情'},
        hidden: true
      },
    ]
  },
   {
    path: '/agentNewRent',
    component: Layout,
    children: [
      {
        path: 'publishSeekRent',
        component: () => import('@/views/agentNewRent/publishSeekRent'),
        name: 'publishSeekRentNew1',
        meta: { title: '发布租箱'},
        hidden: true
      },
    ]
  },
   {
    path: '/carServer',
    component: Layout,
    children: [
      {
        path: 'searchCar',
        component: () => import('@/views/carServer/searchCar'),
        name: 'searchCar2',
        meta: { title: '找车源'},
      },
    ]
  },
   {
    path: '/carServer',
    component: Layout,
    children: [
      {
        path: 'searcsearchCarInfohCar',
        component: () => import('@/views/carServer/searchCarInfo'),
        name: 'searchCarInfo2',
        meta: { title: '车源详情'},
        hidden: true
      },
    ]
  },
     {
    path: '/yardServer',
    component: Layout,
    children: [
      {
        path: 'searchYard',
        component: () => import('@/views/yardServer/searchYard'),
        name: 'searchYard2',
        meta: { title: '找堆场'},
      },
    ]
  },
   {
    path: '/yardServer',
    component: Layout,
    children: [
      {
        path: 'searchYardInfo',
        component: () => import('@/views/yardServer/searchYardInfo'),
        name: 'searchYardInfo2',
        meta: { title: '车源详情'},
        hidden: true
      },
    ]
  },
]
//集装箱公司公用

export const constantRoutesXd = [
   {
    path: '/boxRent',
    component: Layout,
    children: [
      {
        path: 'seekRentBox',
        component: () => import('@/views/boxRent/seekRentBox/index'),
        name: 'seekRentBoxNew1',
        meta: { title: '租箱市场'}
      },
     
    ]
  },
  {
    path: '/boxNewRent',
    component: Layout,
    children: [
      {
        path: 'needsOfHuiDiaoBox',
        component: () => import('@/views/boxNewRent/needsOfHuiDiaoBox/index'),
        name: 'needsOfHuiDiaoBox1',
        meta: { title: '广告发布'}
      },
    ]
  },
   {
    path: '/orderManage',
    component: Layout,
    children: [
      {
        path: 'rentOrder',
        component: () => import('@/views/orderManage/rentOrder/index'),
        name: 'orderManageRentOrderNew1',
        meta: { title: '订单管理'}
      },
    ]
  },
   {
    path: '/placingOrder',
    component: Layout,
    children: [
      {
        path: 'exportOrder/details',
        component: () => import('@/views/placingOrder/exportOrder/details'),
        name: 'orderInfoXDNew1',
        meta: { title: '订单详情'},
        hidden: true
      },
    ]
  },
   {
    path: '/placingOrder',
    component: Layout,
    children: [
      {
        path: 'exportOrder/detaisInfo',
        component: () => import('@/views/placingOrder/exportOrder/detaisInfo'),
        name: 'detaisInfo22',
        meta: { title: '租箱详情'},
        hidden: true
      },
    ]
  },
    {
    path: '/boxRent',
    component: Layout,
    children: [
      {
        path: 'seekRentNew',
        component: () => import('@/views/boxRent/seekRentBox/seekRent'),
        name: 'seekRentNew1',
        meta: { title: '下单详情'},
        hidden: true
      },
    ]
  },
   {
    path: '/boxNewRent',
    component: Layout,
    children: [
      {
        path: 'publish',
        component: () => import('@/views/boxNewRent/needsOfHuiDiaoBox/publishHuiDiao'),
        name: 'publishHuiDiaoNew111',
        meta: { title: '发布租箱'},
        hidden: true
      },
    ]
  },
   {
    path: '/boxManageMyBox',
    component: Layout,
    children: [
      {
        path: 'myBox',
        component: () => import('@/views/boxManage/myBox/index'),
        name: 'myBox',
        meta: { title: '集装箱管理'}
      },
    ]
  },
   {
    path: '/boxManageYard',
    component: Layout,
    children: [
       {
        path: 'yard',
        component: () => import('@/views/boxManage/yard/index'),
        name: 'yard',
        meta: { title: '堆场管理'}
      },
    ]
  },
   {
    path: '/boxManage',
    component: Layout,
    children: [
       {
        path: 'purchaseRecord',
        component: () => import('@/views/boxManage/myBox/purchaseRecord'),
        name: 'purchaseRecord',
        meta: { title: '购箱记录'}
      }
    ]
  },
]

// let userType = userStore.userType
// 集装箱公司动态路由，基于用户权限动态去加载

/* companyRole - 'zx','putBox','cars','sellBox'
 * tags:[
    'rent', // 租赁
    'box',  //集装箱
    'sellBox', //售箱
    'returnBox', //回调箱
    'carServer', //集卡车服务
    'server', // 集装箱服务
    'financial', //财务
    'yard', // 堆场
    'dataAnaly' // 数据分析
    ]
 * 通过 companyRole，tags 控制路由菜单
*/



// 货代动态路由，基于用户权限动态去加载
// tags:['carServer','yard','boxServer','server','financial',news,super] 
//货代
export const dynamicRoutes_hd = [ // eg
  {
    path: '/index?comRole=zx',
    component: 'Layout',
    meta: { title: '工作台', icon: 'home', tags: ['rent', 'returnBox', 'buyBox'] }, 
    roles:['zx']
  },
  {
    path: '/boxRentAgent',
    component: 'Layout',
    meta: { title: '租箱', icon: 'jizhuangxiangfuwu', tags: ['rent',] },
    redirect: 'rentBox',
    name: 'boxRentAgent', //key （同级name须保持唯一性）
    roles: ['zx'],
    children: [
      {
        path: 'rentBox',
        name: 'rentBox',
        meta: { title: '租箱', tags: ['rent'] },
        // component:() => import('@/views/boxRentAgent/rentBox/index')
         component: 'boxRentAgent/rentBox/index',
      },
      {
        path: 'rentBoxInfo',
        name: 'rentBoxInfo',
        meta: { title: '租箱详情',tags:['rent'] },
        component: 'boxRentAgent/rentBox/rentBoxInfo',
        hidden: true
      },
      {
        path: 'xiaDan',
        name: 'xiaDan',
        meta: { title: '下单页面',tags:['rent'] },
        component: 'boxRentAgent/rentBox/xiaDan',
        hidden: true
      },
    ]
  },
  {
    path: '/myRentBox',
    component: 'Layout',
    meta: { title: '我的租箱', icon: 'jizhuangxiangfuwu', tags: ['rent',] },
    redirect: 'myRentBox',
    name: 'myRentBox', //key （同级name须保持唯一性）
    roles: ['zx'],
    children: [
      {
        path: 'myRentBox',
        name: 'myRentBox',
        meta: { title: '我的租箱',tags:['rent'] },
        component: 'myRentBox/index',
        hidden: false
      },
    ]
  },
  {
    path: '/boxSeekRent',
    component: 'Layout',
    meta: { title: '集装箱求租', icon: 'jizhuangxiangfuwu', tags: ['rent',] },
    redirect: 'boxSeekRent',
    name: 'boxSeekRent', //key （同级name须保持唯一性）
    roles: ['zx'],
    alwaysShow:true,
    children: [
       {
        path: 'boxSeekRent',
        name: 'boxSeekRent',
        meta: { title: '求租箱需求',tags:['rent'] },
        component: 'boxSeekRent/index',
      },
       {
        path: 'publishSeekRent',
        name: 'publishSeekRent',
        meta: { title: '发布求租箱' ,tags:['rent']},
        component: 'boxSeekRent/publishSeekRent',
        hidden: true
      },
    ]
  },
  {
    path: '/agentBuyBox',
    component: 'Layout',
    meta: { title: '购箱', icon: 'jizhuangxiangfuwu', tags: ['buyBox',] },
    redirect: 'agentBuyBox',
    name: 'agentBuyBox', //key （同级name须保持唯一性）
    roles: ['zx'],
    children: [
    {
        path: 'agentBuyBox',
        name: 'agentBuyBox',
        meta: { title: '购箱',tags:['buyBox'] },
        component: 'agentBuyBox/index',
      },
      {
        path: 'agentBuyBoxInfo',
        name: 'agentBuyBoxInfo',
        meta: { title: '购箱详情',tags:['buyBox'],keepAlive:false},
        component: 'agentBuyBox/agentBuyBoxInfo',
        hidden: true
      },
      {
        path: 'agentBuy',
        name: 'agentBuy',
        meta: { title: '下单详情',tags:['buyBox'],keepAlive:false},
        component: 'agentBuyBox/agentBuy',
        hidden: true
      }
    ]
  },
  {
    path: '/agentMarketHuiDiaoBox',
    component: 'Layout',
    meta: { title: '回调箱', icon: 'jizhuangxiangfuwu', tags: ['returnBox',] },
    redirect: 'agentMarketHuiDiaoBox',
    name: 'agentMarketHuiDiaoBox', //key （同级name须保持唯一性）
    roles: ['zx'],
    children: [
      {
        path: 'agentMarketHuiDiaoBox',
        name: 'agentMarketHuiDiaoBox',
        meta: { title: '回调箱',tags:['returnBox'] },
        component: 'agentMarketHuiDiaoBox/index',
      },
      {
        path: 'agentHuiDiaoBoxInfo',
        name: 'agentHuiDiaoBoxInfo',
        meta: { title: '回调箱详情',tags:['returnBox'] },
        component: 'agentMarketHuiDiaoBox/agentHuiDiaoBoxInfo',
        hidden: true
      },
      {
        path: 'agentHuiDiao',
        name: 'agentHuiDiao',
        meta: { title: '下单页面',tags:['returnBox'] },
        component: 'agentMarketHuiDiaoBox/agentHuiDiao',
        hidden: true
      },
    ]
  },
  {
    path: '/myHuiDiaoBox',
    component: 'Layout',
    meta: { title: '我的回调箱', icon: 'jizhuangxiangfuwu', tags: ['returnBox',] },
    redirect: 'myHuiDiaoBox',
    name: 'myHuiDiaoBox',  
    roles: ['zx'],
    children: [
    {
        path: 'myHuiDiaoBox',
        name: 'myHuiDiaoBox',
        meta: { title: '我的回调箱',tags:['returnBox'] },
        component: 'myHuiDiaoBox/index',
        hidden: false
      },
    ]
  },
  {
    path: '/agentBoxHuiDiao',
    component: 'Layout',
    meta: { title: '集装箱回调', icon: 'jizhuangxiangfuwu',tags:['returnBox',] },
    redirect: 'agentBoxHuiDiao',
    name: 'agentBoxHuiDiao', //key （同级name须保持唯一性）
    roles: ['zx'],
    alwaysShow:true,
    children: [
       
      {
        path: 'agentBoxHuiDiao',
        name: 'agentBoxHuiDiao',
        meta: { title: '回调箱服务',tags:['returnBox'] },
        component: 'agentBoxHuiDiao/index',
      },
      {
        path: 'publish',
        name: 'publishHuiDiao1',
        meta: { title: '发布回调箱',tags:['returnBox'] },
        component: 'agentBoxHuiDiao/publishHuiDiao',
        hidden: true
      }, 
    ]
  },
  {
    path: '/agentBoxSeekBuy',
    component: 'Layout',
    meta: { title: '集装箱求购', icon: 'jizhuangxiangfuwu',tags:['buyBox',] },
    redirect: 'agentBoxSeekBuy',
    name: 'agentBoxSeekBuy', //key （同级name须保持唯一性）
    roles: ['zx'],
     alwaysShow:true,
    children: [
      {
        path: 'agentBoxSeekBuy',
        name: 'agentBoxSeekBuy',
        meta: { title: '求购箱服务',tags:['buyBox'] },
        component: 'agentBoxSeekBuy/index',
      },
      {
        path: 'publishPurchase',
        name: 'publishPurchase',
        meta: { title: '发布求购箱',tags:['buyBox'] },
        component: 'agentBoxSeekBuy/publishPurchase',
        hidden: true
      },
      {
        path: 'publish',
        name: 'publishHuiDiao1',
        meta: { title: '发布回调箱',tags:['buyBox'] },
        component: 'agentBoxSeekBuy/publishHuiDiao',
        hidden: true
      }, 
    ]
  },
  {
    path: '/orderManageHD',
    component: 'Layout',
    meta: { title: '订单管理', icon: 'dingdanguanli',tags:['rent','returnBox','buyBox',] },
    roles: ['zx'],
    name: 'orderManageHD', //key （同级name须保持唯一性）
    alwaysShow:true,
    children: [
      {
        path: 'agentRentOrder',
        name: 'agentRentOrder',
        meta: { title: '租箱订单',tags:['rent'] },
        component: 'orderManageHD/rentOrder/agentRentOrder',
      },
      {
        path: 'orderInfoRent',
        name: 'orderInfoRent',
        hidden: true,
        meta: { title: '订单详情' ,tags:['rent']},
        component: 'orderManageHD/rentOrder/orderInfo',
      },
      {
        path: 'agentHuiDiaoOrder',
        name: 'agentHuiDiaoOrder',
        meta: { title: '回调箱订单',tags:['returnBox'] },
        component: 'orderManageHD/huiDiaoOrder/agentHuiDiaoOrder',
      },
      {
        path: 'agentHuiDiaoOrderInfo',
        name: 'agentHuiDiaoOrderInfo',
        hidden: true,
        meta: { title: '订单详情' ,tags:['returnBox']},
        component: 'orderManageHD/huiDiaoOrder/agentHuiDiaoOrderInfo',
      },
      {
        path: 'agentBuyOrder',
        name: 'agentBuyOrder',
        meta: { title: '购箱订单',tags:['buyBox'] },
        component: 'orderManageHD/buyOrder/agentBuyOrder',
      },
      {
        path: 'agentBuyOrderInfo',
        name: 'agentBuyOrderInfo',
        hidden: true,
        meta: { title: '订单详情' ,tags:['buyBox']},
        component: 'orderManageHD/buyOrder/agentBuyOrderInfo',
      },
    ]
  },
  {
    path: '/tiXiangManageHD',
    component: 'Layout',
    meta: { title: '提箱管理', icon: 'tixiangguanli',tags:['rent', 'returnBox',] },
    roles: ['zx'],
    name: 'tiXiangManageHD', //key （同级name须保持唯一性）
    alwaysShow:true,
    children: [
      {
        path: 'tiXiangManageHD',
        name: 'tiXiangManageHD',
        meta: { title: '提箱单管理',tags:['rent', 'returnBox'] },
        component: 'tiXiangManageHD/index',
      },
      {
        path: 'releaseInfo1',
        name: 'releaseInfo1',
        // hidden: true,
        meta: { title: '提箱记录' ,tags:['rent', 'returnBox']},
        component: 'tiXiangManageHD/releaseInfo',
      },
    ]
  },
  {
    path: '/tiXiangManageBuyBox',
    component: 'Layout',
    meta: { title: '提箱管理', icon: 'huanxiang', tags: ['buyBox'] },
    roles: ['zx'],
    name: 'tiXiangManageBuyBox', //key （同级name须保持唯一性）
    children: [
      {
        path: 'tiXiangManageBuyBox',
        name: 'tiXiangManageBuyBox',
        meta: { title: '提箱单管理', tags: ['buyBox'] },
        component: 'tiXiangManageBuyBox/index',
      },
      {
        path: 'tiXiangManageBuyBoxInfo',
        name: 'tiXiangManageBuyBoxInfo',
        // hidden: true,
        meta: { title: '提箱记录', tags: ['buyBox'] },
        component: 'tiXiangManageBuyBox/tiXiangManageBuyBoxInfo',
      },
    ]
  },
  {
    path: '/huanXiangManageHD',
    component: 'Layout',
    meta: { title: '还箱管理', icon: 'huanxiang' ,tags:['rent','returnBox']},
    roles: ['zx'],
    name: 'huanXiangManageHD', //key （同级name须保持唯一性）
    alwaysShow:true,
    children: [
      {
        path: 'huanXiangManageHD',
        name: 'huanXiangManageHD',
        meta: { title: '还箱单管理',tags:['rent','returnBox'] },
        component: 'huanXiangManageHD/index',
      },
      {
        path: 'releaseInfoHD',
        name: 'releaseInfoHD',
        // hidden: true,
        meta: { title: '还箱记录',tags:['rent','returnBox'] },
        component: 'huanXiangManageHD/releaseInfo',
      },
    ]
  },
  {
    path: '/carServer',
    component: 'Layout',
     meta: { title: '集卡车队服务', icon: 'chuzu',tags:['carServer'] },
    roles: ['zx'],
    redirect: 'searchCar',
    name: 'carServer', //key （同级name须保持唯一性）
    children: [
      {
        path: 'searchCar',
        name: 'searchCar',
        meta: { title: '找车源' ,tags:['carServer']},
        component: 'carServer/searchCar',
      },
      {
        path: 'searchCarInfo',
        name: 'searchCarInfo',
        meta: { title: '车源详情' ,tags:['carServer']},
        component: 'carServer/searchCarInfo',
        hidden: true
      }
    ]
  },
  {
    path: '/financialManageHD',
    component: 'Layout',
    meta: { title: '财务管理', icon: 'chuzu' ,tags:['boxServer','financial']},
    roles: ['zx'],
    redirect: 'agentInvoicesManage',
    name: 'financialManageHD', //key （同级name须保持唯一性）
    children: [
      {
        path: 'agentInvoicesManage',
        name: 'agentInvoicesManage',
        meta: { title: '发票管理' ,tags:['boxServer','financial']},
        component: 'financialManageHD/agentInvoicesManage',
      },
      {
        path: 'huiDiaoBoxNeedTack',
        name: 'huiDiaoBoxNeedTack',
        meta: { title: '回调箱应收管理' ,tags:['boxServer','financial']},
        component: 'financialManageHD/huiDiaoBoxNeedTack',
      },
      {
        path: 'agentHuiDiaoSettleDetail',
        name: 'agentHuiDiaoSettleDetail',
        meta: { title: '回调结算明细' ,tags:['boxServer','financial']},
        component: 'financialManageHD/agentHuiDiaoSettleDetail',
      },
      {
        path: 'agentOrderSettleDetail',
        name: 'agentOrderSettleDetail',
        meta: { title: '订单结算明细' ,tags:['boxServer','financial']},
        component: 'financialManageHD/agentOrderSettleDetail',
      }
      ,
      {
        path: 'overdueRentalFee',
        name: 'overdueRentalFee',
        meta: { title: '租箱超期费管理' ,tags:['boxServer','financial']},
        component: 'financialManageHD/overdueRentalFee',
      },
    ]
  },
  // {
  //   path: '/system',
  //   component: 'Layout',
  //   hidden: false,
  //   meta: { title: '系统管理', icon: 'system' },
  //   roles: ['zx'],
  //   // permissions: ['system:role:edit'],
  //   redirect: 'user',
  //   name: 'system', //key （同级path/name须保持唯一性）
  //   children: [
  //     {
  //       path: 'user',
  //       name: 'user',
  //       meta: { title: '用户管理' },
  //       component: 'system/user/index',
  //     },
  //     {
  //       path: 'role',
  //       name: 'role',
  //       meta: { title: '角色管理' },
  //       component: 'system/role/index',
  //     },
  //     {
  //       path: 'menu',
  //       component: 'system/menu/index',
  //       name: 'menu',
  //       meta: { title: '菜单管理' }
  //     },
  //   ]
  // }
]

//集装箱公司
export const dynamicRoutes_xd = [ // eg
  {
    path: '/index?comRole=putBox',
    component: 'Layout',
    meta: { title: '工作台', icon: 'home', tags: ['rent', 'sellBox', 'returnBox'] },
    name: 'index',
    roles: ['putBox']
  },
  {
    path: '/boxRent',
    component: 'Layout',
    meta: { title: '集装箱出租', icon: 'chuzu', tags: ['rent'] },
    roles:['putBox'],
    redirect: 'myOutBox',
    name: 'boxRent', //key （同级name须保持唯一性）
    children: [
      {
        path: 'myOutBox',
        name: 'myOutBox',
        meta: { title: '我的出租箱', tags:['rent','box'] },
        component: 'boxRent/myOutBox/index',
      },
      {
        path: 'publish',
        name: 'publishBox',
        meta: { title: '发布租箱', tags:['rent','box'] },
        component: 'boxRent/myOutBox/publish',
        hidden: true
      },
      // {
      //   path: 'imgSpace',
      //   name: 'imgSpace',
      //   meta: { title: '图片空间' , tags:['rent']},
      //   component: 'boxRent/imgSpace/index',
      // },
      
      {
        path: 'seekRentBox',
        name: 'seekRentBox',
        meta: { title: '求租箱', tags:['rent','box'] },
        component: 'boxRent/seekRentBox/index',
      },
      {
        path: 'seekRentBoxInfo',
        name: 'seekRentBoxInfo',
        meta: { title: '求租箱详情', tags:['rent','box'] },
        component: 'boxRent/seekRentBox/seekRentBoxInfo',
        hidden: true
      },
      {
        path: 'seekRent',
        name: 'seekRent',
        meta: { title: '下单详情', tags:['rent','box'] },
        component: 'boxRent/seekRentBox/seekRent',
        hidden: true
      },
    ]
  },
  {
    path: '/boxHuiDiao',
    component: 'Layout',
    meta: { title: '集装箱回调', icon: 'chuzu', tags: ['returnBox'] },
    roles:['putBox'],
    redirect: 'index',
    name: 'boxHuiDiao', //key （同级name须保持唯一性）
    children: [
     {
        path: 'marketHuiDiaoBox',
        name: 'marketHuiDiaoBox',
        meta: { title: '回调箱' , tags:['returnBox','box']},
        component: 'boxHuiDiao/marketHuiDiaoBox/index',
      },
      {
        path: 'huiDiaoBoxInfo',
        name: 'huiDiaoBoxInfo',
        meta: { title: '回调箱详情', tags:['returnBox','box'] },
        component: 'boxHuiDiao/marketHuiDiaoBox/huiDiaoBoxInfo',
        hidden: true
      },
      {
        path: 'huiDiao',
        name: 'huiDiao',
        meta: { title: '下单详情' , tags:['returnBox','box']},
        component: 'boxHuiDiao/marketHuiDiaoBox/huiDiao',
        hidden: true
      },
      {
        path: 'index',
        name: 'index',
        meta: { title: '回调箱需求', tags:['returnBox','box'] },
        component: 'boxHuiDiao/needsOfHuiDiaoBox/index',
      },
      {
        path: 'publish',
        name: 'publishHuiDiao',
        meta: { title: '发布回调箱', tags:['returnBox','box'] },
        component: 'boxHuiDiao/needsOfHuiDiaoBox/publishHuiDiao',
        hidden: true
      },
      {
        path: 'imgSpace',
        name: 'imgSpace1',
        meta: { title: '图片空间', tags:['rent','returnBox'] },
        component: 'boxHuiDiao/imgSpace',
        hidden: true
      }
    ]
  },
  {
    path: '/boxManage',
    component: 'Layout',
    meta: { title: '集装箱管理', icon: 'jizhuangxiangguanli', tags: [ 'box'] },
    roles:['putBox'],
    redirect: 'myBox',
    name: 'boxManage', //key （同级name须保持唯一性）
    children: [
      {
        path: 'myBox',
        name: 'myBox',
        meta: { title: '我的集装箱' , tags:['box']},
        component: 'boxManage/myBox/index',
      },
      {
        path: 'purchaseRecord',
        name: 'purchaseRecord',
        meta: { title: '购箱记录' , tags:['box']},
        component: 'boxManage/myBox/purchaseRecord'
      },
      {
        path: 'yard',
        name: 'yard',
        meta: { title: '我的堆场' , tags:['box']},
        component: 'boxManage/yard/index',
      },
      {
        path: 'publishyard',
        name: 'publishyard',
        meta: { title: '发布堆场' , tags:['box']},
        component: 'boxManage/publishyard',
      }
    ]
  },
  {
    path: '/orderManage',
    component: 'Layout',
    meta: { title: '订单管理', icon: 'dingdanguanli', tags: ['rent', 'returnBox'] },
    roles:['putBox'],
    name: 'orderManage', //key （同级name须保持唯一性）
    alwaysShow:true,
    children: [
      {
        path: 'orderManage',
        name: 'orderManage',
        meta: { title: '出租箱订单', tags:['rent'] },
        component: 'orderManage/rentOrder/index',
      },
      {
        path: 'orderInfo',
        name: 'orderInfo',
        hidden: true,
        meta: { title: '订单详情' , tags:['rent']},
        component: 'orderManage/rentOrder/orderInfo',
      },
      {
        path: 'boxOwnerHuiDiaoOrder',
        name: 'boxOwnerHuiDiaoOrder',
        meta: { title: '回调箱订单', tags:['returnBox'] },
        component: 'orderManage/huiDiaoOrder/boxOwnerHuiDiaoOrder',
      },
      {
        path: 'boxOwnerHuiDiaoOrderInfo',
        name: 'boxOwnerHuiDiaoOrderInfo',
        hidden: true,
        meta: { title: '订单详情', tags:['returnBox'] },
        component: 'orderManage/huiDiaoOrder/boxOwnerHuiDiaoOrderInfo',
      },
    ]
  },
  {
    path: '/tiXiangManage',
    component: 'Layout',
    meta: { title: '提箱管理', icon: 'tixiangguanli', tags: ['rent', 'returnBox'] },
    roles:['putBox'],
    name: 'tiXiangManage', //key （同级name须保持唯一性）
    children: [
      {
        path: 'tiXiangManage',
        name: 'tiXiangManage',
        meta: { title: '提箱单管理' , tags:['rent','returnBox']},
        component: 'tiXiangManage/index',
      },
      {
        path: 'releaseInfo',
        name: 'releaseInfo',
        meta: { title: '提箱记录' , tags:['rent','returnBox']},
        component: 'tiXiangManage/releaseInfo',
      },
    ]
  },
  {
    path: '/huanXiangManage',
    component: 'Layout',
    meta: { title: '还箱管理', icon: 'huanxiang', tags: ['rent', 'returnBox'] },
    roles:['putBox'],
    name: 'huanXiangManage', //key （同级name须保持唯一性）
    children: [
      {
        path: 'huanXiangManage',
        name: 'huanXiangManage',
        meta: { title: '还箱单管理' , tags:['rent', 'returnBox']},
        component: 'huanXiangManage/index',
      },
      {
        path: 'releaseInfo2',
        name: 'releaseInfo2',
        meta: { title: '还箱记录', tags:['rent', 'returnBox'] },
        component: 'huanXiangManage/releaseInfo',
      },
    ]
  },
  {
    path: '/financialManage',
    component: 'Layout',
    meta: { title: '财务管理', icon: 'chuzu', tags: ['financial'] },
    roles:['putBox'],
    redirect: 'rentInvoicesManage',
    name: 'financialManage', //key （同级name须保持唯一性）
    children: [
      {
        path: 'rentInvoicesManage',
        name: 'rentInvoicesManage',
        meta: { title: '发票管理', tags:['financial'] },
        component: 'financialManage/rentInvoicesManage',
      },
      {
        path: 'huiDiaoBoxNeedPay',
        name: 'huiDiaoBoxNeedPay',
        meta: { title: '回调箱应付管理', tags:['financial'] },
        component: 'financialManage/huiDiaoBoxNeedPay',
      },
      {
        path: 'rentHuiDiaoSettleDetail',
        name: 'rentHuiDiaoSettleDetail',
        meta: { title: '回调结算明细' , tags:['financial']},
        component: 'financialManage/rentHuiDiaoSettleDetail',
      },
      {
        path: 'rentOrderSettleDetail',
        name: 'rentOrderSettleDetail',
        meta: { title: '订单结算明细' , tags:['financial']},
        component: 'financialManage/rentOrderSettleDetail',
      },
      {
        path: 'overdueFee',
        name: 'overdueFee',
        meta: { title: '出租箱超期费管理' , tags:['financial']},
        component: 'financialManage/overdueFee',
      },
      {
        path: 'operating',
        name: 'operating',
        meta: { title: '业务费管理' ,tags:['financial']},
        component: 'financialManage/operating/index',
      },
      {
        path: 'operatingInfo',
        name: 'operatingInfo',
        meta: { title: '业务费明细管理' ,tags:['financial']},
        component: 'financialManage/operatingInfo/index',
      },
      {
        path: 'stowageInfo',
        name: 'stowageInfo',
        meta: { title: '堆存费明细管理' ,tags:['financial']},
        component: 'financialManage/stowageInfo/index',
      },
      {
        path: 'bills',
        name: 'bills',
        meta: { title: '账单管理' ,tags:['financial']},
        component: 'financialManage/bills/index',
      },
       {
        path: 'billsInfo',
        name: 'billsInfo',
        hidden:true,
        meta: { title: '账单详情' ,tags:['financial']},
        component: 'financialManage/bills/components/updateModalForm',
      },
       {
        path: 'analysis',
        name: 'analysis',
        meta: { title: '财务分析' ,tags:['financial']},
        component: 'financialManage/analysis/index',
      },
    
    ]
  },
  {
    path: '/yardServer',
    component: 'Layout',
    meta: { title: '精选堆场', icon: 'chuzu', tags: ['yard'] },
    roles:['putBox'],
    redirect: 'searchYard',
    name: 'yardServer', //key （同级name须保持唯一性）
    children: [
      {
        path: 'searchYard',
        name: 'searchYard',
        meta: { title: '找堆场', tags:['yard'] },
        component: 'yardServer/searchYard',
      },
      {
        path: 'searchYardInfo',
        name: 'searchYardInfo',
        meta: { title: '堆场详情', tags:['yard'] },
        component: 'yardServer/searchYardInfo',
        hidden: true
      }
    ]
  },
  {
    path: '/dataAnaly',
    component: 'Layout',
    meta: { title: '经营分析', icon: 'chuzu', tags: ['dataAnaly'] },
    roles:['putBox'],
    redirect: 'dataAnalyRent',
    name: 'dataAnaly', //key （同级name须保持唯一性）
    children: [
      {
        path: 'dataAnalyRent',
        name: 'dataAnalyRent',
        meta: { title: '出租箱经营分析', tags:['dataAnaly'] },
        component: 'dataAnaly/dataAnalyRent',
      },
      {
        path: 'dataAnalyReturn',
        name: 'dataAnalyReturn',
        meta: { title: '回箱经营分析', tags:['dataAnaly'] },
        component: 'dataAnaly/dataAnalyReturn'
      }
    ]
  },

  //旧数据，保留参考
  // {
  //   path: '/carServer',
  //   component: 'Layout',
  //   meta: { title: '集卡车队服务', icon: 'chuzu', tags: ['carServer'] },
  //   roles:['putBox'],
  //   redirect: 'searchCar',
  //   name: 'carServer', //key （同级name须保持唯一性）
  //   children: [
  //     {
  //       path: 'searchCar',
  //       name: 'searchCar',
  //       meta: { title: '找车源', tags:['carServer'] },
  //       component: 'carServer/searchCar',
  //     },
  //     {
  //       path: 'searchCarInfo',
  //       name: 'searchCarInfo',
  //       meta: { title: '车源详情', tags:['carServer'] },
  //       component: 'carServer/searchCarInfo',
  //       hidden: true
  //     }
  //   ]
  // },
  // {
  //   path: '/system',
  //   component: 'Layout',
  //   hidden: false,
  //   meta: { title: '系统管理', icon: 'system' },
  //   roles:['putBox'],
  //   // permissions: ['system:role:edit'],
  //   redirect: 'user',
  //   name: 'system', //key （同级name须保持唯一性）
  //   children: [
  //     {
  //       path: 'user',
  //       name: 'user',
  //       meta: { title: '用户管理' },
  //       component: 'system/user/index',
  //     },
  //     {
  //       path: 'role',
  //       name: 'role',
  //       meta: { title: '角色管理' },
  //       component: 'system/role/index',
  //     },
  //     {
  //       path: 'menu',
  //       component: 'system/menu/index',
  //       name: 'menu',
  //       meta: { title: '菜单管理' }
  //     },
  //   ]
  // }
]

//集卡车管理
// [car,transport]
export const dynamicRoutes_jk = [ // eg
  // {
  //   path: '/index',
  //   component: 'Layout',
  //   meta: { title: '工作台', icon: 'home', tags: ['car', 'transport'] },
  //   roles:['cars'], 
  // },
  {
    path: '/carManage',
    component: 'Layout',
    meta: { title: '集卡车管理', icon: 'huanxiang', tags: ['car'] },
    roles:['cars'], 
    name: 'carManage', //key （同级name须保持唯一性）
    children: [
      {
        path: 'carManage',
        name: 'carManage',
        meta: { title: '我的集卡车' , tags: ['car']},
        component: 'carManage/index',
      },
      {
        path: 'publishCar',
        name: 'publishCar',
        meta: { title: '发布集卡车源' , tags: ['car']},
        component: 'carManage/publishCar',
        hidden: true,
      },
      {
        path: 'imgSpace2',
        name: 'imgSpace2',
        // hidden: true,
        meta: { title: '图片空间' , tags: ['car']},
        component: 'carManage/imgSpace2',
      },
    ]
  },
  {
    path: '/system',
    component: 'Layout',
    hidden: false,
    meta: { title: '系统管理', icon: 'system' },
    roles:['cars'], 
    // permissions: ['system:role:edit'],
    redirect: 'user',
    name: 'system', //key （同级name须保持唯一性）
    children: [
      {
        path: 'user',
        name: 'user',
        meta: { title: '用户管理' },
        component: 'system/user/index',
      },
      {
        path: 'role',
        name: 'role',
        meta: { title: '角色管理' },
        component: 'system/role/index',
      },
      {
        path: 'menu',
        component: 'system/menu/index',
        name: 'menu',
        meta: { title: '菜单管理' }
      },
    ]
  }
]

//卖箱管理
//[box,rent,returnBox,sellBox]
export const dynamicRoutes_mx = [ // eg
  {
    path: '/index?comRole=sellBox',
    component: 'Layout',
    meta: { title: '工作台', icon: 'home', tags: ['sellBox'] },
    roles:['sellBox'],
  },
  {
    path: '/boxSell',
    component: 'Layout',
    meta: { title: '集装箱出售', icon: 'huanxiang', tags: ['sellBox'] },
    roles:['sellBox'],
    redirect: 'mySellBox',
    name: 'boxSell', //key （同级name须保持唯一性）
    children: [
      {
        path: 'mySellBox',
        name: 'mySellBox',
        meta: { title: '我的出售箱',tags: ['sellBox']},
        component: 'boxSell/mySellBox/index',
      },
      {
        path: 'publishSellBox',
        name: 'publishSellBox',
        meta: { title: '发布售箱', tags: ['sellBox'],keepAlive: false },
        component: 'boxSell/mySellBox/publishSellBox',
        hidden: true,
      },
      {
        path: 'seekSellBox',
        name: 'seekSellBox',
        meta: { title: '求购箱', tags: ['sellBox'] },
        component: 'boxSell/buyBox/seekSellBox',
      },
      {
        path: 'boxDetails',
        name: 'boxDetails',
        hidden: true,
        meta: { title: '求购箱详情', tags: ['sellBox'] },
        component: 'boxSell/buyBox/boxDetails',
      },
    ]
  },
  {
    path: '/orderManageSellBox',
    component: 'Layout',
    meta: { title: '订单管理', icon: 'huanxiang', tags: ['sellBox'] },
    roles:['sellBox'],
    redirect: 'sellOrder',
    name: 'orderManageSellBox', //key （同级name须保持唯一性）
    alwaysShow:true,
    children: [
       {
        path: 'sellOrder',
        name: 'sellOrder',
        meta: { title: '出售箱订单',tags:['sellBox'] },
        component: 'orderManageSellBox/sellOrder',
      },
      {
        path: 'sellOrderInfo',
        name: 'sellOrderInfo',
        hidden: true,
        meta: { title: '订单详情' ,tags:['sellBox']},
        component: 'orderManageSellBox/sellOrderInfo',
      },
    ]
  },
  {
    path: '/tiXiangManageSellBox',
    component: 'Layout',
    meta: { title: '提箱管理', icon: 'huanxiang', tags: ['sellBox'] },
    roles:['sellBox'], 
    name: 'tiXiangManageSellBox', //key （同级name须保持唯一性）
    children: [
       {
        path: 'tiXiangManageSellBox',
        name: 'tiXiangManageSellBox',
        meta: { title: '售箱提箱单管理',tags:['sellBox'] },
        component: 'tiXiangManageSellBox/index',
      },
     {
        path: 'tiXiangManageSellBoxInfo',
        name: 'tiXiangManageSellBoxInfo',
        // hidden: true,
        meta: { title: '提箱记录' ,tags:['sellBox']},
        component: 'tiXiangManageSellBox/tiXiangManageSellBoxInfo',
      },
    ]
  },
  {
    path: '/financialManageBoxSell',
    name: 'financialManageBoxSell', //key （同级name须保持唯一性）
    meta: { title: '财务管理', icon: 'chuzu', tags: ['financial'] },
    component: 'Layout',
    roles: ['sellBox'],
    redirect: 'boxSellInvoicesManage',
    children: [
      {
        path: 'boxSellInvoicesManage',
        name: 'boxSellInvoicesManage',
        meta: { title: '发票管理' ,tags:['financial']},
        component: 'financialManageBoxSell/boxSellInvoicesManage',
      },
      {
        path: 'boxSellOrderSettleDetail',
        name: 'boxSellOrderSettleDetail',
        meta: { title: '订单结算明细' ,tags:['financial']},
        component: 'financialManageBoxSell/boxSellOrderSettleDetail',
      }
    ]
  }
]

//  path: '/boxSell',
//     component: 'Layout',
//     meta: { title: '集装箱出售', icon: 'huanxiang', tags: ['rent', 'box', 'sellBox'] },
//     roles:['sellBox'],
//     redirect: 'mySellBox',
//     name: 'boxSell', //key （同级name须保持唯一性）
//     children: [
export const dynamicRoutes_public = [
  {
    path: '/webInfoManage',
    component: 'Layout',
    meta: { title: '消息管理', icon: 'huanxiang',tags: ['rent', 'box','sellBox', 'returnBox','carServer','server','financial','boxServer','yard','buyBox']},
    roles:['putBox','zx','sellBox'],
    // permissions: ['system:role:edit'],
    redirect: 'webAnnouncement',
    name: 'webInfoManage', //key （同级name须保持唯一性）
    alwaysShow:true,
    type:2,
    children: [
      {
        path: 'webAnnouncement',
        name: 'webAnnouncement',
        meta: { title: '平台公告',tags:['rent', 'box','sellBox', 'returnBox','carServer','server','financial','boxServer','yard','buyBox'] },
        component: 'webInfoManage/webAnnouncement',
        type:1,
      },
      {
        path: 'webAnnouncementInfo',
        name: 'webAnnouncementInfo',
        meta: { title: '公告详情',tags:['rent', 'box','sellBox', 'returnBox','carServer','server','financial','boxServer','yard','buyBox'] },
        component: 'webInfoManage/webAnnouncementInfo',
        hidden: true,
        type:1,
      },
      {
        path: 'systemAnnouncement',
        name: 'systemAnnouncement',
        meta: { title: '系统消息',tags:['rent', 'box','sellBox', 'returnBox','carServer','server','financial','boxServer','yard','buyBox'] },
        component: 'webInfoManage/systemAnnouncement',
        type:1,
      },
      {
        path: 'systemAnnouncementInfo',
        name: 'systemAnnouncementInfo',
        meta: { title: '消息详情',tags:['rent', 'box','sellBox', 'returnBox','carServer','server','financial','boxServer','yard','buyBox'] },
        component: 'webInfoManage/systemAnnouncementInfo',
        hidden: true,
        type:1,
      },
    ]
  },
  {
    path: '/enterpriseManage',
    component: 'Layout',
    meta: { title: '企业管理', icon: 'huanxiang',tags: ['rent', 'box','sellBox', 'returnBox','carServer','server','financial','boxServer','yard','buyBox']},
    roles:['putBox','zx','sellBox'],
    // permissions: ['system:role:edit'],
    redirect: 'companyInfo',
    name: 'enterpriseManage', //key （同级name须保持唯一性）
    alwaysShow:true,
    type:2,
    children: [
      {
        path: 'companyInfo',
        name: 'companyInfo',
        meta: { title: '企业信息',tags: ['rent', 'box','sellBox', 'returnBox','carServer','server','financial','boxServer'] },
        component: 'enterpriseManage/companyInfo/index',
        type:1,
      },
        {
          path: 'roleManage',
          name: 'roleManage',
          meta: { title: '角色权限', tags: ['rent', 'box', 'sellBox', 'returnBox', 'carServer', 'server', 'financial', 'boxServer']},
          component: 'enterpriseManage/rights/index',
          type:1,
        },
      {
        path: 'userManage',
        name: 'userManage',
        meta: { title: '用户管理', tags: ['rent', 'box', 'sellBox', 'returnBox', 'carServer', 'server', 'financial', 'boxServer'] },
        component: 'enterpriseManage/userManage/index',
        type:1,
      },
      // {
      //   path: 'accountManage',
      //   name: 'accountManage',
      //   meta: { title: '账号管理', tags: ['rent', 'box', 'sellBox', 'returnBox', 'carServer', 'server', 'financial', 'boxServer'] },
      //   component: 'enterpriseManage/accountManage/index',
      // },
      {
        path: 'realAuthentication',
        name: 'realAuthentication',
        meta: { title: '实名认证', tags: [] },
        component: 'enterpriseManage/realAuthentication/index',
        type:1,
      },
      {
        path: 'accountCenter',
        name: 'accountCenter',
        meta: { title: '个人资料', tags: ['rent', 'box', 'sellBox', 'returnBox', 'carServer', 'server', 'financial', 'boxServer'] },
        component: 'enterpriseManage/accountCenter/index',
        type:1,
      },
      // {
      //   path: 'AES-256-GCM',
      //   name: 'AES-256-GCM',
      //   meta: { title: 'AES-256-GCM', tags: ['rent', 'box', 'sellBox', 'returnBox', 'carServer', 'server', 'financial', 'boxServer'] },
      //   component: 'enterpriseManage/AES-256-GCM',
      //   type:1,
      // },
    ]
  }
]
//平台方
export const dynamicRoutes_Admin = [
  {
    path: '/platformManagement',
    component: 'Layout',
    meta: { title: '用户管理', icon: 'huanxiang', tags: ['admin','root'] },
    roles: ['admin', 'root'],
    redirect: 'adminUserManage',
    name: 'platformManagement', //key （同级name须保持唯一性）
    alwaysShow: true,
    type:2,
    children: [
      {
        path: 'adminUserManage',
        name: 'adminUserManage',
        meta: { title: '企业信息管理', tags: ['admin', 'root'] },
        component: 'platformManagement/adminUserManage/index',
        type:1,
      },
      {
        path: 'enterpriseDetails',
        name: 'enterpriseDetails',
        meta: { title: '企业信息详情', tags: ['admin', 'root'] },
        component: 'platformManagement/adminUserManage/enterpriseDetails',
        hidden: true,
        type:1,
      },
      {
        path: 'adminAccountManage',
        name: 'adminAccountManage',
        meta: { title: '企业账号管理', tags: ['admin', 'root'] },
        component: 'platformManagement/adminAccountManage/index',
        type:1,
      }
    ]
  },
  {
    path: '/webInfoManage',
    component: 'Layout',
    meta: { title: '消息管理', icon: 'huanxiang', tags: ['admin', 'root'] },
    roles: ['admin', 'root'],
    // permissions: ['system:role:edit'],
    redirect: 'webAnnouncement',
    name: 'webInfoManage', //key （同级name须保持唯一性）
    alwaysShow: true,
    type:2,
    children: [
       {
        path: 'webAnnouncement',
        name: 'webAnnouncement',
        meta: { title: '平台公告',tags: ['admin', 'root'] },
        component: 'webInfoManage/webAnnouncement',
        type:1,
      },
      {
        path: 'webAnnouncementInfo',
        name: 'webAnnouncementInfo',
        meta: { title: '公告详情',tags: ['admin', 'root'],activeMenu :'/webInfoManage/webAnnouncement'},
        component: 'webInfoManage/webAnnouncementInfo',
        hidden: true
      },
      {
        path: 'systemAnnouncement',
        name: 'systemAnnouncement',
        meta: { title: '系统消息',tags: ['admin', 'root'] },
        component: 'webInfoManage/systemAnnouncement',
        type:1,
      },
      {
        path: 'systemAnnouncementInfo',
        name: 'systemAnnouncementInfo',
        meta: { title: '消息详情',tags: ['admin', 'root'] ,activeMenu :'/webInfoManage/systemAnnouncement'},
        component: 'webInfoManage/systemAnnouncementInfo',
        hidden: true
      },
    ]
  },
  {
    path: '/systemManage',
    component: 'Layout',
    meta: { title: '系统管理', icon: 'system', tags: ['admin', 'root'] },
    roles: ['admin', 'root'],
    // permissions: ['system:role:edit'],
    redirect: 'admin',
    name: 'systemManage', //key （同级name须保持唯一性）
    alwaysShow: true,
    type:2,
    children: [
      {
        path: 'account',
        name: 'account',
        meta: { title: '账号管理', tags: ['admin', 'root'] },
        component: 'systemManage/account/index',
        type:1,
        },
        {
          path: 'rights',
          name: 'rights',
          meta: { title: '角色权限', tags: ['admin', 'root'] },
          component: 'systemManage/rights/index',
          type:1,
        },
        {
          path: 'menu',
          name: 'menu',
          meta: { title: '菜单管理', tags: ['admin', 'root'] },
          component: 'systemManage/menu/index',
          type:1, 
        },
      {
        path: 'OperationLog',
        name: 'OperationLog',
        meta: { title: '操作日志', tags: ['admin', 'root'] },
        component: 'systemManage/OperationLog/index',
        type:1,
      },
    ]
  },
    {
    path: '/enterpriseManage',
    component: 'Layout',
    meta: { title: '企业管理', icon: 'huanxiang',tags: ['admin', 'root']},
    roles: ['admin', 'root'],
    hidden: true,
    redirect: 'companyInfo',
    name: 'enterpriseManage', //key （同级name须保持唯一性）
    alwaysShow:true,
    type:2,
    children: [
      {
        path: 'companyInfo',
        name: 'companyInfo',
        meta: { title: '企业信息',tags: ['admin', 'root']},
        component: 'enterpriseManage/companyInfo/index',
        type:1,
      },
    
      {
        path: 'accountCenter',
        name: 'accountCenter',
        meta: { title: '个人资料', tags: ['admin', 'root'] },
        component: 'enterpriseManage/accountCenter/index',
        type:1,
      },
    ]
  }
]

export const dynamicRoutes = [...dynamicRoutes_hd, ...dynamicRoutes_xd,  ...dynamicRoutes_jk, ...dynamicRoutes_mx, ...dynamicRoutes_public, ...dynamicRoutes_Admin]

const addconstantRoutes=[...constantRoutes, ...constantRoutesHd,...constantRoutesXd,]
const router = createRouter({
  history: createWebHashHistory(),
  routes: addconstantRoutes,
  // scrollBehavior(to, from, savedPosition) {
  //   if (savedPosition) {
  //     return savedPosition
  //   } else {
  //     return { top: 0 }
  //   }
  // },
});

export default router;
